package com.example.parkdemo.adapter

import android.annotation.SuppressLint
import android.provider.ContactsContract.Data

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

import com.example.base.SelMothResultItem
import com.example.parkdemo.R
import java.text.SimpleDateFormat
import java.util.*

class SelMothAdapter : BaseQuickAdapter<SelMothResultItem, BaseViewHolder>(R.layout.item_month) {
    @SuppressLint("SimpleDateFormat")
    override fun convert(holder: BaseViewHolder, item: SelMothResultItem) {
        val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
        val start = Date(item.startTime)
        val startString = format.format(start)
        holder.setText(R.id.start_time, startString)
        holder.setText(R.id.start_address, item.startAddress)
        val end = Date(item.endTime)
        val endString = format.format(end)
        holder.setText(R.id.end_time, endString)
        holder.setText(R.id.end_address, item.endAddress)

    }
}